/*
 * @Author: 107w 8801453+lu-shangru@user.noreply.gitee.com
 * @Date: 2023-04-04 16:06:16
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2024-04-30 14:17:40
 * @Description:
 *
 * Copyright (c) 2023 by 107w, All Rights Reserved.
 */
import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/assets/theme/index.css'
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n
import Contextmenu from 'vue-contextmenujs'
// 加载Ant核心组件库
import { Menu, Dropdown, Popover, Drawer, Steps, Tag, Tree, Switch, Radio, Select, Divider, Button, Popconfirm, message, FormModel, Collapse, Badge, Pagination, Descriptions, Modal, Icon, Input } from 'ant-design-vue'
import 'ant-design-vue/dist/antd.css'
Vue.use(Menu)
Vue.use(Dropdown)
Vue.use(Popover)
Vue.use(Drawer)
Vue.use(Steps)
Vue.use(Tag)
Vue.use(Tree)
Vue.use(Switch)
Vue.use(Radio)
Vue.use(Select)
Vue.use(Divider)
Vue.use(Button)
Vue.use(Popconfirm)
Vue.use(FormModel)
Vue.use(Collapse)
Vue.use(Badge)
Vue.use(Pagination)
Vue.use(Descriptions)
Vue.use(Modal)
Vue.use(Icon)
Vue.use(Input)
import '@/styles/index.scss' // global css

// 注册组件
import App from './App'
import store from './store'
import router from './router'
import i18n from '@/lang'
import '@/icons' // icon
import '@/permission' // permission control
import './assets/iconfont/iconfont.css'

Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
})
Vue.use(Contextmenu)

// markdown编辑器
import VueMarkdownEditor from '@kangc/v-md-editor'
import '@kangc/v-md-editor/lib/style/base-editor.css'
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js'
import '@kangc/v-md-editor/lib/theme/style/vuepress.css'

import Prism from 'prismjs'

VueMarkdownEditor.use(vuepressTheme, {
  Prism
})

Vue.use(VueMarkdownEditor)

// markdown预览组件
import VMdPreview from '@kangc/v-md-editor/lib/preview'
import '@kangc/v-md-editor/lib/style/preview.css'
import githubTheme from '@kangc/v-md-editor/lib/theme/github.js'
import '@kangc/v-md-editor/lib/theme/style/github.css'

// highlightjs
import hljs from 'highlight.js'

VMdPreview.use(githubTheme, {
  Hljs: hljs
})

Vue.use(VMdPreview)
// -------------------------------

Vue.config.productionTip = false
// 局部引入ant design vue message组件
Vue.prototype.$message = message
Vue.prototype.$confirm = Modal.confirm
new Vue({
  el: '#app',
  router,
  store,
  i18n,
  render: h => h(App)
})
